home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
rs232101.zip
/
RS232.DOC
< prev
next >
Wrap
Text File
|
1993-07-01
|
35KB
|
843 lines
**************************************************************************
RS232
Version 1.01
Ring Development
Maple Grove, Minnesota
**************************************************************************
The files created during extraction are as follows :
FILE SIZE
--------------------------------
RS232. DOC 34840
RS232. EXE 15620
RS232A. EXE 7920
XT. EXE 3720
TY. EXE 7620
TYBIG. EXE 9240
ADDLINES. EXE 6525
READ. ME 3170
ORDER. FRM 1220
**************************************************************************
TABLE OF CONTENTS
-------------------
1 Introduction
1.1 Program Installation
2 RS-232 Basics
3 RS232 Program Usage
3.1 Cabling to PC
3.2 Theory of Operation
3.3 User Interface
3.4 Command Line Arguments
3.5 If you have a real slow PC and/or fast baud rate - Overrun Error
4 Utility Program Usage
4.1 RS232A
4.2 XT
4.3 TY
4.4 TYBIG
4.5 ADDLINES
5 Closing
**************************************************************************
1 INTRODUCTION
The RS232 program here should enable you to debug most of your
RS-232 problems much faster than before. With the program, you
can actually see the data transmitted in both directions on a real
time basis. The program also supports the monitoring of all hardware
lines for those nasty hardware handshaking problems.
5 utility programs are also provided to aid in wading through the
data generated. These utilities are described in Section 4.
There are no hardware changes needed in the PC, the program does
all the monitoring necessary through the 2 COM ports. The program
can be used if your PC has only 1 COM port, though the program
will give the most beneficial information if you have 2. Nowadays,
a second COM port can be added to any PC for a minimum investment.
The hardware needed to use this program is a simple homemade cable
that you create. The cable you need can be probably be built in an
hour from spare parts lying around. Section 3.1 discusses the cable
that most likely will be the one you need.
1.1 PROGRAM INSTALLATION
Installing the RS232 program and the associated utilities is quite
simple. It is simply a matter of copying the .EXE files to any
directory where you want to run the program(s). A more versatile
directory would be a directory that is already in the 'PATH' of
the PC. This enables operation of the program(s) from any place
on the disk. A typical directory in the PATH is \DOS.
To copy the program(s) to the \DOS directory :
1) COPY *.EXE \DOS (copy files to \DOS)
To copy the program(s) to a new directory (ex \RS232) :
1) MD \RS232 (make RS232 directory)
3) COPY *.EXE \RS232 (copy files to \RS232)
**************************************************************************
2 RS-232 BASICS
RS-232 is a communication standard that has existed for many
years. It's main purpose is to transfer data from one device
to another. For instance, a tester to a host computer so the
computer can store the test results on disk.
The standard RS-232 connector has 25 pins, though a lot of
PC's have a 9 pin connector. The pin assignments for each
signal is as follows (for 25 and 9 pin connectors) :
TABLE I
SIGNAL PIN # (25) PIN # (9) IN/OUT
-------------------------------------------------------------
Ground 1 N/A --
Transmit Data 2 3 Out
Receive Data 3 2 In
Request to Send (RTS) 4 7 Out
Clear to Send (CTS) 5 8 In
Data Set Ready (DSR) 6 6 In
Signal Ground 7 5 --
Data Carrier Detect (DCD) 8 1 In
Data Terminal Ready (DTR) 20 4 Out
Ring Indicator (RI) 22 9 In
Note that besides receive/transmit data, there are 2 output
lines and 4 input lines. These are used for modem control and
hardware handshaking, which will be discussed later.
The simplest communication hookup has 3 wires; transmit data,
receive data, and signal ground. The transmit and receive lines
need to be crossed (whether in the connecting cable or internal
to the either device). See Figure 1. This is so the transmit
line of device 1 is tied to the receive line of device 2, and
vice versa.
This configuration only supports software handshaking. Suppose
device 1 transmits a block of data to device 2. Once device 2 has
received the data, it transmits back to device 1. Device 2 can
transmit a character meaning "OK, send the next block of data" or
transmit a character meaning "I don't like the data, send that last
block of data again". The actual protocol used is determined by
the software running on both devices.
DEVICE 1 (25 Pin) DEVICE 2 (25 Pin)
PIN 2----------------\ /--------------------PIN 2 Transmit
\/
/\
PIN 3----------------/ \--------------------PIN 3 Receive
PIN 7----------------------------------------PIN 7 Signal GND
(FIGURE 1)
Another configuration uses 5 wires and this is used primarily
for a hardware handshaking protocol. It uses the 3 wires in
Figure 1 and also the 2 wires shown in Figure 2.
DEVICE 1 (25 Pin) DEVICE 2 (25 Pin)
PIN 4----------------\ /--------------------PIN 4 RTS
\/
/\
PIN 5----------------/ \--------------------PIN 5 CTS
(FIGURE 2)
From Table I above, you see that pin 4 (RTS) is an output signal
and pin 5 (CTS) is an input signal. No data is transferred through
these pins. They are just control lines using a specific voltage
level for the high state and another voltage level for the low
state. The software running in device 1 can program pin 4 to be
high or low and then device 2 can read this value as high/low
and act accordingly. Here is a typical example. Suppose device 1
is a large mainframe and device 2 is a tester of some sort. Now
assume that there are many testers (say 10) and all are hooked
up to our mainframe (one tester on 10 different mainframe COM
ports), our central data gathering point. It would be difficult
for our mainframe to gather data on all 10 testers simultaneously,
so we implement a hardware handshaking protocol. Our protocol says:
"A tester can not transmit it's test results until it sees the CTS
line go high". If the CTS line is low, our tester will not transmit
it's test results. So now, all our mainframe software has to do is:
1) Set the RTS line on the port for tester 1 high, this sets
the CTS line high at tester 1.
2) Tester 1 sees that CTS has gone high, then it starts its
transmission of the test results.
3) After completion of the test results, set the RTS line low
for tester 1. This will inhibit tester 1 from further
transmissions.
4) Now set the RTS line for tester 2, and repeat the above
steps for all 10 testers.
Pins 20 and 6 may also be used as pins 4 and 5 were above.
Another possible use for the input pins is to connect an
input pin to a +5V signal in the remote device (for example,
a power supply voltage). This is convenient if the remote
device is not always powered on. Your program in essence can
monitor the power supply of the remote device and know when
it is powered up and safe to 'talk' to.
Pins 8 (DCD) and 22 (RI) are normally used in commu